package com.itheima.service;

import com.itheima.dao.UserDao;
import com.itheima.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author 徐柯老师
 * @Description
 * @Tel/微信：15074816437
 * @Version 1.0
 **/
@Service
public class UserServiceImpl implements  IUserService {


    @Autowired
    private UserDao userDao;

    public List<User> findUsers(){
        return userDao.findUsers();
    }


    public User getUser(Long id){
        return userDao.getUser(id);
    }


    /*
     * @Author 徐柯老师
     * @Tel/微信：15074816437
     * @Description
     * @Date 13:07 2019/5/29
     * @Param [user]
     * @return int
     **/
    public int saveUser(User user){
        return userDao.saveUser(user);
    }

    /*
     * @Author 徐柯老师
     * @Tel/微信：15074816437
     * @Description
     * @Date 13:07 2019/5/29
     * @Param [user]
     * @return int
     **/
    public int updateUser(User user){
        return userDao.updateUser(user);
    }

    /*
     * @Author 徐柯老师
     * @Tel/微信：15074816437
     * @Description
     * @Date 13:07 2019/5/29
     * @Param [user]
     * @return int
     **/
    public int deleteById(Long id){
        return userDao.deleteById(id);
    }
}